/**
 * 客户端环境的网络参数设置 throttling
 * 模仿webpagetest网络配置
 * https://github.com/WPO-Foundation/webpagetest/blob/master/www/settings/connectivity.ini.sample
 *
 */

    /**
     * throttling参数：rttMs、throughputKbps、uploadThroughputKbps、
     *                 downloadThroughputKbps、requestLatencyMs、cpuSlowdownMultiplier
     *  
     */
    let throttlings = [{
        rttMs: 40,
        throughputKbps: 10 * 1024,
        cpuSlowdownMultiplier: 1,
    }, {
        //"Cable (5/1 Mbps 28ms RTT)"
        rttMs: 28,
        uploadThroughputKbps: 1000000,
        downloadThroughputKbps: 5000000,
        cpuSlowdownMultiplier: 1,
    }, {
        //"DSL (1.5 Mbps/384 Kbps 50ms RTT)"
        rttMs: 50,
        uploadThroughputKbps: 384000,
        downloadThroughputKbps: 1500000,
        cpuSlowdownMultiplier: 1
    }, {
        //"3G Slow (400 Kbps, 400ms RTT)" : timeout=480
        //"Emerging Markets 3G (400 Kbps, 400ms RTT)" : timeout=480, hidden=1
        rttMs: 400,
        uploadThroughputKbps: 400000,
        downloadThroughputKbps: 400000,
        cpuSlowdownMultiplier: 1
    }, {
        //"3G (1.6 Mbps/768 Kbps 300ms RTT)" ： timeout=120
        rttMs: 300,
        uploadThroughputKbps: 768000,
        downloadThroughputKbps: 1600000,
        cpuSlowdownMultiplier: 1
    }, {
        //"3G Fast (1.6 Mbps/768 Kbps 150ms RTT)" ： timeout=120
        rttMs: 150,
        uploadThroughputKbps: 768000,
        downloadThroughputKbps: 1600000,
        cpuSlowdownMultiplier: 1
    }, {
        //"4G (9 Mbps, 170ms RTT)"
        rttMs: 170,
        uploadThroughputKbps: 9000000,
        downloadThroughputKbps: 9000000,
        cpuSlowdownMultiplier: 1
    }, {
        //"LTE (12 Mbps, 70ms RTT)"
        rttMs: 70,
        uploadThroughputKbps: 12000000,
        downloadThroughputKbps: 12000000,
        cpuSlowdownMultiplier: 1
    }, {
        //"Mobile Edge (240 Kbps/200 Kbps 840ms RTT)" : timeout=300
        rttMs: 840,
        uploadThroughputKbps: 200000,
        downloadThroughputKbps: 240000,
        cpuSlowdownMultiplier: 1
    }, {
        //"2G (280 Kbps/256 Kbps 800ms RTT)" : timeout=300
        rttMs: 800,
        uploadThroughputKbps: 256000,
        downloadThroughputKbps: 280000,
        cpuSlowdownMultiplier: 1
    }, {
        //"56K Dial-Up (49/30 Kbps 120ms RTT)" : timeout=300
        rttMs: 120,
        uploadThroughputKbps: 49000,
        downloadThroughputKbps: 49000,
        cpuSlowdownMultiplier: 1
    }, {
        //"FIOS (20/5 Mbps 4ms RTT)"
        rttMs: 4,
        uploadThroughputKbps: 5000000,
        downloadThroughputKbps: 20000000,
        cpuSlowdownMultiplier: 1
    }, 
    // {
    //     //"Native Connection (No Traffic Shaping)"
    //     // rttMs: 0,
    //     uploadThroughputKbps: 0,
    //     downloadThroughputKbps: 0,
    //     cpuSlowdownMultiplier: 1
    // }
    ]

module.exports = throttlings;